package com.yqya.springboot.shiro.practice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yqya.springboot.shiro.practice.biz.UserInfoBizService;
import com.yqya.springboot.shiro.practice.domain.UserInfo;
import com.yqya.springboot.shiro.practice.dto.UserInfoDTO;

/**
 * 用户登录
 *
 * @author Kevin
 * @date 2019-07-28
 */
@RestController
@RequestMapping("/user")
public class UserInfoController {

    @Autowired
    private UserInfoBizService userInfoBizService;

    /**
     * 添加用户
     *
     * @param dto
     * @return
     */
    @PostMapping(value = "/")
    public String saveUser(@RequestBody UserInfoDTO dto) {
        UserInfo item = userInfoBizService.save(dto);
        return "添加用户成功 \n" + item;
    }
}
